#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
int my_system(const char *filename)
{
    char cmd[128]={0};
    strcpy(cmd,"md5sum ");
    strcat(cmd,filename);
    char result[64] = {0};
    FILE *fp = NULL;
    if( (fp = popen(cmd, "r")) == NULL ) {
        perror("popen");
        return -1;
    }
    fgets(result,32,fp);
    pclose(fp);
    printf("result: %s\n", result);
    return 0;
}
int main(int argc, char const *argv[])
{
    my_system(argv[1]);
    return 0;
}

